package cn.home.DYX.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.home.DYX.mapper.HomeInstitutionMapper;
import cn.home.DYX.domain.HomeInstitution;
import cn.home.DYX.service.IHomeInstitutionService;

/**
 * 机构Service业务层处理
 * 
 * @author 丁宇翔
 * @date 2025-04-09
 */
@Service
public class HomeInstitutionServiceImpl implements IHomeInstitutionService 
{
    @Autowired
    private HomeInstitutionMapper homeInstitutionMapper;

    /**
     * 查询机构
     * 
     * @param id 机构主键
     * @return 机构
     */
    @Override
    public HomeInstitution selectHomeInstitutionById(Long id)
    {
        return homeInstitutionMapper.selectHomeInstitutionById(id);
    }

    /**
     * 查询机构列表
     * 
     * @param homeInstitution 机构
     * @return 机构
     */
    @Override
    public List<HomeInstitution> selectHomeInstitutionList(HomeInstitution homeInstitution)
    {
        return homeInstitutionMapper.selectHomeInstitutionList(homeInstitution);
    }

    /**
     * 新增机构
     * 
     * @param homeInstitution 机构
     * @return 结果
     */
    @Override
    public int insertHomeInstitution(HomeInstitution homeInstitution)
    {
        return homeInstitutionMapper.insertHomeInstitution(homeInstitution);
    }

    /**
     * 修改机构
     * 
     * @param homeInstitution 机构
     * @return 结果
     */
    @Override
    public int updateHomeInstitution(HomeInstitution homeInstitution)
    {
        return homeInstitutionMapper.updateHomeInstitution(homeInstitution);
    }

    /**
     * 批量删除机构
     * 
     * @param ids 需要删除的机构主键
     * @return 结果
     */
    @Override
    public int deleteHomeInstitutionByIds(Long[] ids)
    {
        return homeInstitutionMapper.deleteHomeInstitutionByIds(ids);
    }

    /**
     * 删除机构信息
     * 
     * @param id 机构主键
     * @return 结果
     */
    @Override
    public int deleteHomeInstitutionById(Long id)
    {
        return homeInstitutionMapper.deleteHomeInstitutionById(id);
    }
}
